import { App } from 'vue';
import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/smart';
import modal from './modal';
import tab from './tab'
import download from './download'

/**
 * 注册全局方法
 * @param app Vue应用实例
 */
export function setupSmartUtils(app: App) {
  // 将工具方法挂载到全局属性
  app.config.globalProperties.handleTree = handleTree;
  app.config.globalProperties.addDateRange = addDateRange;
  app.config.globalProperties.selectDictLabel = selectDictLabel;
  app.config.globalProperties.selectDictLabels = selectDictLabels;
  app.config.globalProperties.parseTime = parseTime;
  app.config.globalProperties.$modal = modal;
  app.config.globalProperties.$tab = tab;
  app.config.globalProperties.$download = download;
}
